package org.aplombh.java.interview.newcoder;

import java.util.Scanner;

//HJ9 提取不重复的整数
public class HJ9_提取不重复的整数 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String a = in.nextLine();
            StringBuilder s = new StringBuilder();
            for (int i = a.length()-1; i >= 0; i--) {
                boolean flag = true;
                for (int j = 0; j < s.length(); j++) {
                    if (a.charAt(i) == s.charAt(j)) {
                        flag = false;
                        break;
                    }
                }
                if (flag) {
                    s.append(a.charAt(i));
                }
            }
            System.out.println(s);
        }
    }
}